//
//  BIDViewController.m
//  Button Fun
//
//  Created by quentin on 15/10/28.
//  Copyright (c) 2015年 QuentinLabs. All rights reserved.
//

#import "BIDViewController.h"

@interface BIDViewController ()

@end

@implementation BIDViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)buttonPressed:(UIButton *)sender {
    NSString* title = [sender titleForState:UIControlStateNormal];
    NSString* plainText = [NSString stringWithFormat:@"%@ button pressed.",title];
//    _statusLabel.text = plainText;
    
    NSMutableAttributedString* styleText = [[NSMutableAttributedString alloc] initWithString:plainText];
    
    NSDictionary* attributes =
    @{
      NSFontAttributeName:[UIFont boldSystemFontOfSize:_statusLabel.font.pointSize]
      };
    
    //NSURLRequestReloadIgnoringLocalAndRemoteCacheData
    NSRange nameRange = [plainText rangeOfString:title];
    [styleText setAttributes:attributes range:nameRange];
    _statusLabel.attributedText = styleText;
}

@end
